<?php

namespace helper;

class SmsHelper
{

    /**
     * 发送短信
     * @param $platform //可选alibaba/tencent
     * @param $params //参考官方文档
     * @return mixed
     */
    static public function sendSms($platform, $params)
    {
        $fun = 'exec'.ucfirst($platform);
        return self::$fun('SendSms',$params);
    }

    /**
     * 阿里短信
     * @param $fun
     * @param $params
     * @return mixed
     */
    static public function execAlibaba($fun,$params)
    {
        $model = new \helper\cloud\Alibaba('sms');
        return $model->execFun('Dysmsapi', '2017-05-25', $fun, $params);
    }

    /**
     * 腾讯短信
     * @param $fun
     * @param $params
     * @return mixed
     */
    static public function execTencent($fun,$params)
    {
        $model = new \helper\cloud\Tencent('sms');
        return $model->execFun('Sms', 'V20210111', $fun, $params);
    }

}